#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int n, m;
int a[N];

struct Bit {
  int n;
  vector<ll> bit;
  void init(int _n) {
    n = _n;
    bit = vector<ll>(n + 1, 0);
  }
  static int lowbit(int x) { return x & -x; }
  void add(int x, ll d) {
    for (int i = x; i <= n; i += lowbit(i)) bit[i] += d;
  }
  ll query(int x) {
    ll res = 0;
    for (int i = x; i > 0; i -= lowbit(i)) res += bit[i];
    return res;
  }
} bit;
int query(int left) {
  int l = 1, r = n;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (bit.query(mid) + left > mid - 1)
      l = mid + 1;
    else
      r = mid - 1;
  }
  return l;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  rep(i, 2, n) cin >> a[i];
  bit.init(n);
  per(i, n, 1) {
    a[i] = query(a[i]);
    bit.add(a[i], 1);
  }
  rep(i, 1, n) cout << a[i] << endl;
  return 0;
}